<?php
require_once('inc_all.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>基督教永灵堂</title>
<meta name="Copyright" content="基督教永灵堂 http://www.ylchurch.org/" />
<meta name="description" content="基督教永灵堂" />
<meta content="基督教,永灵堂,基督教永灵堂" name="keywords" />
<link rel="stylesheet" rev="stylesheet" href="css/home.css" type="text/css" media="all" />
</head>
<body>
<!-- 菜单 -->
<div class="menu">
<ul>
	<?php
		//父级菜单
		$dm_cd_data_list = G('db')->query("select * from ylt_dm_cai_dan where id_dm_cai_dan_fu = 0 and bz_you_xiao = 'Y' order by shun_xu");
		$html = array();
		if($dm_cd_data_list)
		{
			foreach($dm_cd_data_list as $dm_cd)
			{
				$html[] = '<li><a href="'.$dm_cd['gong_neng'].'">'.$dm_cd['ming_cheng'].'<!--[if IE 7]><!--></a><!--<![endif]--><!--[if lte IE 6]><table><tr><td><![endif]-->';
				//子菜单
				$dm_zi_cd_data_list =  G('db')->query("select * from ylt_dm_cai_dan where id_dm_cai_dan_fu = ".$dm_cd['id_dm_cai_dan']);
				if($dm_zi_cd_data_list)
				{
					$html[] = '<ul>';
					foreach($dm_zi_cd_data_list as $dm_zi_cd)
					{
						$html[] = '<li><a href="'.$dm_zi_cd['gong_neng'].'" title="'.$dm_zi_cd['ming_cheng'].'">'.$dm_zi_cd['ming_cheng'].'</a></li>';
					}
					$html[] = '</ul>';
				}
				$html[] = '<!--[if lte IE 6]></td></tr></table></a><![endif]--></li>';
			}
		}
		echo @implode("\n", $html);
	?>
</ul>
</div>
<!-- 菜单end -->
<!-- 焦点图 -->
<div class="absolute overflow" id=push style="left: 203px; width: 550px; top: 0px">
<div id="mainpush"></div>
<div id="linkpush" style="background: url(images/pushbg.gif); height: 43px"></div></div>
<script type=text/javascript>
function $(x){
    return document.getElementById(x);
}
rnd.today=new Date();
rnd.seed=rnd.today.getTime(); 
function rnd(){ 
	rnd.seed = (rnd.seed*9301+49297) % 233280; 
	return rnd.seed/(233280.0); 
}
function rand(number){ 
	return Math.ceil(rnd()*number)-1; 
}
//标题 .title
var pushname=["图片一","图片er","图片三","图片四","丰盛生命","图片六"];
//图片 .image
var pushsrc=["images/01.jpg","images/02.jpg","images/03.jpg","images/04.jpg","images/05.jpg","images/06.jpg"];
//链接 .link
var pushlink=["http://www.sharejs.com/#1","http://www.sharejs.com/#2","http://www.sharejs.com/#3","http://www.sharejs.com/#4","http://www.sharejs.com/#5","http://www.sharejs.com/#6"]
var pushshow="";
function showpushlink(num){
	if(!num&&num!=0){
		mainpushnum++;
		if(mainpushnum>5) mainpushnum=0;
		num=mainpushnum;
	}
	for(i=0;i<6;i++){
		$("linkpush"+i).className="";
		$("linkpush"+i).innerHTML="<img src='images/push"+i+".gif'>";
	}
	$("linkpush"+num).className="linkpushhere";
	$("linkpush"+num).innerHTML="<strong class='fontorange'>"+(num+1)+".</strong>"+pushname[num];
	$("pushimg").src=pushsrc[num];
	$("pushimglink").href=pushlink[num];
	$("pushimg").alt=pushname[num];
}
//初始化
for(i=0;i<6;i++){
	pushshow+='<a href="'+pushlink[i]+'" onmouseover="showpushlink('+i+');clearInterval(rollid)" id="linkpush'+i+'" target="_blank"><img src="images/push'+i+'.gif"></a>';
}
$("linkpush").innerHTML=pushshow;
var mainpushnum=rand(6);
$("linkpush"+mainpushnum).className="linkpushhere";
$("linkpush"+mainpushnum).innerHTML="<strong class='fontorange'>"+(mainpushnum+1)+".</strong>"+pushname[mainpushnum];
$("mainpush").innerHTML='<a href="'+pushlink[mainpushnum]+'" target="_blank" id="pushimglink" onmouseover="clearInterval(rollid)" onmouseout="showattime()"><img src="'+pushsrc[mainpushnum]+'" name="pushimg" width="550" height="330" id="pushimg" alt="'+pushname[mainpushnum]+'" /></a>';
var rollid=setInterval("showpushlink()",5000);
function showattime(){
	showpushlink();
	rollid=setInterval("showpushlink()",5000);
}
</script>
<!-- 焦点图end -->
</body>
</html>